package com.sky.utils;

import java.util.UUID;

public class UUIDUtil {
    /**
     * 私有构造方法，禁止实例化
     */
    private UUIDUtil() {
        throw new UnsupportedOperationException("工具类禁止实例化");
    }

    /**
     * 生成带连字符的标准 UUID (32字符 + 4连字符)
     * 示例：550e8400-e29b-41d4-a716-446655440000
     */
    public static String generate() {
        return UUID.randomUUID().toString();
    }

    /**
     * 生成不带连字符的 UUID (32字符)
     * 示例：550e8400e29b41d4a716446655440000
     */
    public static String generateWithoutHyphen() {
        return UUID.randomUUID().toString().replace("-", "");
    }

    /**
     * 生成大写 UUID (带连字符)
     * 示例：550E8400-E29B-41D4-A716-446655440000
     */
    public static String generateUpperCase() {
        return generate().toUpperCase();
    }

    /**
     * 生成大写不带连字符的 UUID
     * 示例：550E8400E29B41D4A716446655440000
     */
    public static String generateUpperCaseWithoutHyphen() {
        return generateWithoutHyphen().toUpperCase();
    }

    /**
     * 生成小写 UUID (带连字符)
     * 示例：550e8400-e29b-41d4-a716-446655440000
     */
    public static String generateLowerCase() {
        return generate().toLowerCase();
    }

    /**
     * 生成小写不带连字符的 UUID
     * 示例：550e8400e29b41d4a716446655440000
     */
    public static String generateLowerCaseWithoutHyphen() {
        return generateWithoutHyphen().toLowerCase();
    }
}
